package cn.demo.gecco.geccobean;

import com.geccocrawler.gecco.annotation.Gecco;
import com.geccocrawler.gecco.annotation.Href;
import com.geccocrawler.gecco.annotation.HtmlField;
import com.geccocrawler.gecco.annotation.Request;
import com.geccocrawler.gecco.request.HttpRequest;
import com.geccocrawler.gecco.spider.HtmlBean;

import java.util.List;

/**
 * @ClassName:
 * @PackageName: cn.demo.gecco.geccobean
 * @author: youjp
 * @create: 2019-11-04 08:54
 * @description:
 *      接口HtmlBean：说明该类是一个解析html页面的爬虫
 *      注解@Gecco：告知该爬虫匹配的url格式(matchUrl)和
 *      内容抽取后的bean处理类（pipelines处理类采用管道过滤器模式，可以定义多个处理类）。
 * @Version: 1.0
 */
@Gecco(matchUrl = "http://localhost:8081/a1.html", pipelines = {"consolePipeline", "allSortPipeline"})
public class AllSort implements HtmlBean {


    @Request
    private HttpRequest request;

    /**
     * 解析到的所有含房屋信息的li标签
     */
    @HtmlField(cssPath = "#houselist-mod-new li")
    private List<HouseInfo> houseInfoList;


    /**
     * 下一页 url
     */
    @Href
    @HtmlField(cssPath = "#content > div.sale-left > div.multi-page > a.aNxt")
    private String nextPage;


    public HttpRequest getRequest() {
        return request;
    }

    public void setRequest(HttpRequest request) {
        this.request = request;
    }

    public List<HouseInfo> getHouseInfoList() {
        return houseInfoList;
    }

    public void setHouseInfoList(List<HouseInfo> houseInfoList) {
        this.houseInfoList = houseInfoList;
    }

    public String getNextPage() {
        return nextPage;
    }

    public void setNextPage(String nextPage) {
        this.nextPage = nextPage;
    }


}
